Skip to content

Improve matrix editor resize: viewport awareness, performance, robust…#8

Merged
leeliu103 merged 1 commit intomainfrom
fix/matrix-editor-resize-improvements
Nov 25, 2025
Merged

Improve matrix editor resize: viewport awareness, performance, robust…#8
leeliu103 merged 1 commit intomainfrom
fix/matrix-editor-resize-improvements

Conversation

@leeliu103
Copy link
Owner

…ness

Fix 5 critical issues in modal resize functionality:

  1. Viewport-aware bounds management

    • Add window resize listener to recompute effectiveMinSize
    • Dialog stays within viewport when browser window resizes
    • Prevents modal from getting stuck off-screen
  2. Proper max-size clamping

    • Respect true maxWidth/maxHeight with 16px margin
    • Shift or shrink dialog when near viewport edges
    • No longer forces dialog outside viewport
  3. Robust resize state management

    • Add mouseleave and blur listeners to stop resize
    • Check event.buttons === 0 in handleResize
    • Resize reliably stops even if mouseup is lost
  4. Smooth performance with RAF batching

    • Batch cell-size and scrollbar updates into single RAF callback
    • Eliminate multiple synchronous layout passes
    • No more jank during fast resize
  5. Remove duplicate side-effects

    • Gate ResizeObserver callback while resizeState is active
    • Prevent double RAF scheduling
    • Cleaner control flow

🤖 Generated with Claude Code

…ness

Fix 5 critical issues in modal resize functionality:

1. Viewport-aware bounds management
   - Add window resize listener to recompute effectiveMinSize
   - Dialog stays within viewport when browser window resizes
   - Prevents modal from getting stuck off-screen

2. Proper max-size clamping
   - Respect true maxWidth/maxHeight with 16px margin
   - Shift or shrink dialog when near viewport edges
   - No longer forces dialog outside viewport

3. Robust resize state management
   - Add mouseleave and blur listeners to stop resize
   - Check event.buttons === 0 in handleResize
   - Resize reliably stops even if mouseup is lost

4. Smooth performance with RAF batching
   - Batch cell-size and scrollbar updates into single RAF callback
   - Eliminate multiple synchronous layout passes
   - No more jank during fast resize

5. Remove duplicate side-effects
   - Gate ResizeObserver callback while resizeState is active
   - Prevent double RAF scheduling
   - Cleaner control flow

All 109 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@leeliu103 leeliu103 merged commit adc21fd into main Nov 25, 2025
1 check passed
@leeliu103 leeliu103 deleted the fix/matrix-editor-resize-improvements branch November 25, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant